package ru.pb.game.network.clients;

import ru.pb.game.network.GNetworkEngine;
import ru.pb.game.network.engine.auth.packets.sendable.AUTH_REQUEST;
import ru.pb.global.network.MacAddr;
import ru.pb.global.network.engine.NioClient;
import ru.pb.global.network.engine.NioService;
import ru.pb.global.network.engine.NioSession;
import ru.pb.global.network.engine.core.interfaces.IPacketExecutor;

/**
 * Клиент Сервера авторитизации
 * 
 * @author Felixx
 */
public class AuthServerClient extends NioClient<AuthServerClient>
{
	public AuthServerClient(NioSession<AuthServerClient> authServerClientNioSession, NioService<AuthServerClient> authServerClientNioService, IPacketExecutor executor)
	{
		super(authServerClientNioSession, authServerClientNioService, executor);
	}

	@Override
	public void onStart()
	{
		sendPacket(new AUTH_REQUEST());
	}

	@Override
	public void onEnd()
	{
		GNetworkEngine.getInstance().connect();
	}

	@Override
	public void onForceEnd()
	{
		GNetworkEngine.getInstance().connect();
	}

	@Override
	public void catchException(Throwable cases)
	{
		cases.printStackTrace();
	}

	@Override
	public MacAddr getMac()
	{
		return null;
	}

	@Override
	public void setMAC(MacAddr mac)
	{

	}
}